package com.example.springstack.springsecurity.service;

import com.example.springstack.springsecurity.entity.AuthenticationInfoVo;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Qiangfanghao
 */
public interface JwtService {

    /**
     * 生成 jwt token
     * @param username
     * @param currentIp
     * @return
     * */
    AuthenticationInfoVo jwtBuild(String username, String currentIp);

    /**
     * jwt 登录验证
     * @param token
     * @param currentIp
     * @param currentUsername
     * @return
     */
    Boolean jwtAuthentication(String token,String currentIp,String currentUsername);

    /**
     * 获取  jwt所需当前用户登录ip
     * @param request
     * @return
     */
    String getJwtCurrentIp(HttpServletRequest request);

}
